#!/bin/bash
go env
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
cd ${JIANMU_WORKSPACE}

pwd 

echo "开始build"

go mod tidy 

go mod vendor

CGO_ENABLED=0 GOOS=${JIANMU_GOOS} GOARCH=${JIANMU_GOARCH} go build -o ${JIANMU_OUT_BIN_NAME} main.go

ls -a

echo "结束build"

echo "{\"bin_dir\": \"${JIANMU_WORKSPACE}/${JIANMU_OUT_BIN_NAME}\"}" > /tmp/result.json